
import 'package:get/get_instance/src/get_instance.dart';

class ControllerHelper {
  ControllerHelper._privateConstructor();

  /// 添加Controller
  static S put<S>(S dependency,
      {String? tag,
        bool permanent = false,
        InstanceBuilderCallback<S>? builder}) =>
      GetInstance().put<S>(dependency, tag: tag, permanent: permanent);

  /// 获取Controller
  static S find<S>({String? tag}) => GetInstance().find(tag: tag);

  static S putOrFind<S>(InstanceBuilderCallback<S> dep, {String? tag}) =>
      GetInstance().putOrFind<S>(dep, tag: tag);

  static bool delete<S>({String? tag}) => GetInstance().delete<S>(tag: tag);
}